SNOW-3385961: improve INFER_SCHEMA zero-row FileNotFoundError message#4201
Open
sfc-gh-fhe wants to merge 3 commits intomainfrom
Open
SNOW-3385961: improve INFER_SCHEMA zero-row FileNotFoundError message#4201sfc-gh-fhe wants to merge 3 commits intomainfrom
sfc-gh-fhe wants to merge 3 commits intomainfrom
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4201 +/- ##
==========================================
+ Coverage 95.10% 95.42% +0.31%
==========================================
Files 171 171
Lines 43840 43842 +2
Branches 7517 7517
==========================================
+ Hits 41696 41835 +139
+ Misses 1334 1226 -108
+ Partials 810 781 -29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
When INFER_SCHEMA returns zero rows, the reader used to raise:
FileNotFoundError: Given path: '{path}' could not be found or is empty.
Zero rows can also mean file-format options silently filtered every
row/header (e.g. PARSE_HEADER on a file with a leading blank line,
SKIP_HEADER exceeding row count, or ON_ERROR=CONTINUE dropping bad
rows). The old message sends users chasing a path-not-found issue
that isn't real.
Keep the exception type (FileNotFoundError) for back-compat, but
rewrite the message to surface both possibilities and append any
applied PARSE_HEADER / SKIP_HEADER / ON_ERROR values that are already
in scope (no extra round-trip).
Update the existing integ assertions in test_filepath_not_exist_or_empty
to match the new wording and to access the message via str(ex_info.value)
so the full (longer) message is compared.
Trim the multi-line comment to a single 3-line note, replace the manual option-hint loop with a list comprehension, and shorten the error message without losing the "path missing or format-option-filtered" information.
1d2543f to
e5a0dee
Compare
sfc-gh-joshi
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-NNNNNNN
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Please write a short description of how your code change solves the related issue.